<?php

namespace App\Http\Controllers;


use App\Models\User;
use App\Repositories\Personal\PersonalRepository;
use App\Repositories\Personal\PersonalFilter;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class PersonalController extends Controller
{
    public function total(PersonalRepository $personalRepository, Request $request)
    {
//        $user = Auth::user();
//        $user_id = $user->id;
        $user_id = 1;
        $total = $personalRepository->getTotal($user_id, new PersonalFilter($request));
        return ['data' => $total];
    }

    public function trend(PersonalRepository $personalRepository, Request $request)
    {
        //        $user = Auth::user();
        //        $user_id = $user->id;
        $user_id = 1;
        $trend = $personalRepository->getTrend($user_id, new PersonalFilter($request));
        return ['data' => $trend];

    }
}


